{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "from six.moves import reload_module\n",
    "from six.moves import urllib\n",
    "\n",
    "# 在线量化平台名称，可选：joinquant、ricequant、uqer\n",
    "QUANT_NAME = 'joinquant'\n",
    "# 版本，默认 master 即为最新版\n",
    "VERSION = 'master'\n",
    "# 更新安装文件？\n",
    "UPDATE_INSTALLER = False\n",
    "\n",
    "REPO_URL = 'https://raw.githubusercontent.com/sinall/ShiPanE-Python-SDK'\n",
    "INSTALLER_URL = '{}/{}/scripts/shipane_sdk_installer.py'.format(REPO_URL, VERSION)\n",
    "INSTALLER_FILENAME = 'shipane_sdk_installer.py'\n",
    "\n",
    "if not os.path.isfile(INSTALLER_FILENAME) or UPDATE_INSTALLER:\n",
    "    urllib.request.urlretrieve(INSTALLER_URL, INSTALLER_FILENAME)\n",
    "\n",
    "import shipane_sdk_installer\n",
    "\n",
    "reload_module(shipane_sdk_installer)\n",
    "\n",
    "shipane_sdk_installer.main([\n",
    "    '--quant=' + QUANT_NAME,\n",
    "    '--version=' + VERSION\n",
    "])"
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 0
}